package de.slothsoft.commons.swing;

import javax.swing.SwingWorker;

public abstract class AbstractSwingWorker<T, V> extends SwingWorker<T, V> {

	public final static String PROPERTY_TASK_NAME = "taskName"; //$NON-NLS-1$
	public final static String PROPERTY_SUB_TASK_NAME = "subTaskName"; //$NON-NLS-1$
	public final static String PROPERTY_MAXIMUM = "maximum"; //$NON-NLS-1$
	public final static String PROPERTY_PROGRESS = "progress"; //$NON-NLS-1$

	private String taskName;
	private String subTaskName;
	private int maximum;

	protected String getTaskName() {
		return this.taskName;
	}

	protected void setTaskName(String taskName) {
		firePropertyChange(PROPERTY_TASK_NAME, this.taskName, taskName);
		this.taskName = taskName;
	}

	protected String getSubTaskName() {
		return this.subTaskName;
	}

	protected void setSubTaskName(String subTaskName) {
		firePropertyChange(PROPERTY_SUB_TASK_NAME, this.subTaskName,
				subTaskName);
		this.subTaskName = subTaskName;
	}

	protected int getMaximum() {
		return this.maximum;
	}

	protected void setMaximum(int maximum) {
		firePropertyChange(PROPERTY_MAXIMUM, this.maximum, maximum);
		this.maximum = maximum;
	}

}
